<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h2 v-text="name"></h2>
       <h2> {{name}}</h2>
       <h2>{{n}}</h2>
       <button @click="add">add</button>
       <button @click="destroy">destroy</button>
    </div>
    <script>
        Vue.config.productionTip=false
        const app=new Vue({
            el:"#app",
            data:{
                name:"hello",
                n:1
            },
            watch:{
                n(){
                    console.log("watch")
                }
            },
            methods:{
                add(){
                    console.log("1111")
                    this.n++
                },
                destroy(){
                    console.log("destroy")
                    this.$destroy()
                }
            },
            beforeCreate(){
                console.log("beforecreat");
                console.log(this)
               /*  debugger */
            },
            created(){
                console.log("created");
                console.log(this)
                /* debugger */
            },
            beforeMount(){
                console.log("beforeMounte")
                console.log(this)
                console.log(this.$el)
              /*   debugger */
            },
            mounted(){
                console.log("mounted")
                console.log(this)
                console.log(this.$el)
                /* debugger */
            },
            beforeUpdate(){
                console.log("beforeUpdate")
                console.log(this.n)
                /* debugger */
            },
            updatad(){
                console.log("update");
                console.log(this.n)
                /* debugger */
            },
            beforeDestroy(){
                console.log("beforeDestroy")
                this.add()
            },
            destroyed(){
                console.log("destroyed")
                this.add()
            }
            
        })
    </script>
</body>
</html>